package com.fs.common.base.bean.query;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.List;

@Data
public class BaseQuery {
    @Schema(description = "id")
    private String id;

    @Schema(description = "id列表")
    private List<String> ids;

    @Schema(description = "每页记录数")
    private Long pageSize;

    @Schema(description = "页码，从1开始")
    private Long pageNo;

    @Schema(description = "排除的字段列表", hidden = true)
    private List<String> excludeFields;

    @Schema(description = "排序字段")
    private List<OrderBy> orderBys;

    /**
     * 是否需要根据租户id筛选
     */
    @JsonIgnore
    @Schema(description = "是否根据租户id筛选", hidden = true)
    private Boolean filterWithTenantId = true;

    /**
     * 手动传入的租户id，如果不传，并且要根据租户筛选时，将默认取当前登录用户所属租户<br/>
     * 如果传了，则以传入的为主；但需要忽略前端传入请求，只能后端代码级处理
     */
    @JsonIgnore
    @Schema(description = "租户id", hidden = true)
    private String tenantId;
}
